﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class ConsultantMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.Consultant>
    {
        public ConsultantMap()
        {
            // table
            //ToTable("CMS_Consultant");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.ModelId)
                
                .IsRequired();
            Property(t => t.ContentId)
                
                .IsRequired();
            Property(t => t.ConsultTime)
                
                .IsRequired();
            Property(t => t.Content)
                
                .HasMaxLength(2000)
                .IsRequired();
            Property(t => t.UserName)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.ReplyContent)
                
                .HasMaxLength(2000)
                .IsOptional();
            Property(t => t.ReplyTime)
                
                .IsOptional();
            Property(t => t.Replier)
                
                .HasMaxLength(255)
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

